#include "vm.h"

int main(void){
	//variable declarations
	int index;
	char name[20];
	FILE *input;
	
	//initialize code
	for (index=0; index<MAX_CODE_LENGTH; index++)
		code[index].op = -1;
		
	printf("Enter name of source file: ");
	scanf("%s", name);
	if ((input = fopen(name, "r")) == NULL){
       printf("Unable to open file.\n");
       return 0;
    }
    
    index = 0;
    while(!feof(input)){
       fscanf(input, "%d", &code[index].op);
       fscanf(input, "%d", &code[index].l);
       fscanf(input, "%d", &code[index].m);
       index++;
    }
    fclose(input);
    
    vm();
    return 0;
}
